<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Title</title>
</head>
<body>
<div id="app">
    <h2>{{message}}</h2>
    <h2>当前计数：{{counter}}</h2>
    <h2>计数双倍：{{counter*2}}</h2>
    <h2>展示的信息：{{info.split(" ")}}</h2>

    <h2>{{age>=18?"成年人":"未成年人"}}</h2>
    <h2>{{formatDate(time)}}</h2>

</div>
<script src="https://unpkg.com/vue@3"></script>
<script>
    const app=Vue.createApp({
        data(){
            return {
                message:`Hello Vue`,
                counter:100,
                info:'my name is why',
                age:22,
                time:123
            }
        },
        methods:{
            formatDate:function(date){
                return '2022-10-10-'+date
            }
        }
    })
    app.mount("#app")
</script>
</body>
</html>